<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>EasyShare-留言墙</title>
    <link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}" sizes="32x32">
    <link href="/css/main/bootstrap.min.css" th:href="@{/css/main/bootstrap.min.css}" rel="stylesheet">
    <link href="/css/main/index-style.css" th:href="@{/css/main/index-style.css}" rel="stylesheet">
    <link href="/css/main/index-nprogress.css" th:href="@{/css/main/index-nprogress.css}" rel="stylesheet">
    <link href="/css/main/sidebar-canvi.css" th:href="@{/css/main/sidebar-canvi.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="/js/html5shiv.min.js" type="text/javascript"></script>
    <script src="/js/respond.min.js" type="text/javascript"></script>
    <script src="/js/selectivizr-min.js" type="text/javascript"></script>
    <![endif]-->
    <!--    <link rel="apple-touch-icon-precomposed" href="images/icon/icon.png">
        <link rel="shortcut icon" href="images/icon/favicon.ico">-->
    <meta name="Keywords" content=""/>
    <meta name="description" content=""/>
    <script type="text/javascript">
        //判断浏览器是否支持HTML5
        /*window.onload = function () {
            if (!window.applicationCache) {
                window.location.href = "ie.html";
            }
        }*/
    </script>
</head>

<body>
<span th:if="${refresh==1}">
    <script type="text/javascript">
        location.href = "/page/readerWall";
    </script>
</span>
<div th:replace="~{commons/sidebar :: sidebar}"></div>
<section class="container user-select">
    <div th:replace="~{commons/leftbar :: leftbar}"></div>
    <!--/超小屏幕可见-->
    <div class="content-wrap"><!--内容-->
        <div class="content">
            <div class="content-block">
                <h2 class="title"><strong>读者</strong></h2>
                <div class="face-block">
                    <span class="face" th:each="user:${users}" data-toggle="tooltip" data-placement="top"
                          th:title="${user.getUsername()}"><input type="hidden" th:value="${user.getUserid()}"
                                                                  name="uid"><img
                            src="/img/main/icon/icon.png"
                            th:src="${user.getUserimg() eq null?'/img/main/pine-logo.jpg':user.getUserimg()}"
                            alt="用户头像" class="userImages"></span>
                </div>
            </div>
            <div class="content-block comment">
                <h2 class="title"><strong>留言</strong></h2>
                <form action="/wlm/add" method="post" class="form-inline" id="comment-form">
                    <div class="comment-title">
                        <div class="form-group">
                            <label for="commentName">昵称：</label>
                            <input type="text" name="lmpersonname" class="form-control" id="commentName"
                                   placeholder="你的昵称" maxlength="10">
                        </div>
                        <div class="form-group">
                            <label for="commentEmail">邮箱：</label>
                            <input type="email" name="lmemail" class="form-control" id="commentEmail"
                                   placeholder="非必填项">
                        </div>
                    </div>
                    <div class="comment-form">
                        <textarea placeholder="对本站有什么看法或者建议都可以在此留言哦" name="lmcontent" maxlength="100"
                                  style="font-weight: bolder"></textarea>
                        <div class="comment-form-footer">
                            <div class="comment-form-text" style="color: #1ce678;font-weight: bolder">
                                本站留言无需注册，只需填写昵称和留言内容即可
                            </div>
                            <div class="comment-form-btn">
                                <button type="submit" class="btn btn-default btn-comment">提交评论</button>
                            </div>
                        </div>
                    </div>
                </form>
                <div class="content-block comment-content">
                    <h2 class="title"><strong>最新留言</strong></h2>
                    <ul>
                        <li th:each="lm:${data}"><span
                                class="face"><img src="/img/main/icon/icon.png" th:src="${lm.getLmimg()}"
                                                  alt="Tou"></span>
                            <span class="text"><strong th:text="${lm.getLmpersonname()}">xxx</strong> ([[${#dates.format(lm.getLmcreatetime(),'yyyy-MM-dd HH:mm:ss')}]]) 说：<br/>[[${lm.getLmcontent()}]]</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <div th:replace="~{commons/rightbar :: rightbar}"></div>
    <!--/右侧>992px显示-->
    <footer th:replace="~{commons/footer :: footer}"></footer>
</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script src="/js/jquery-3.1.1.min.js" type="text/javascript" th:src="@{/js/jquery-3.1.1.min.js}"></script>
<script src="/js/main/bootstrap.min.js" type="text/javascript" th:src="@{/js/main/bootstrap.min.js}"></script>
<script src="/js/main/nprogress.js" type="text/javascript" th:src="@{/js/main/nprogress.js}"></script>
<script src="/js/main/index-code.js" type="text/javascript" th:src="@{/js/main/index-code.js}"></script>
<script type="text/javascript">
    $(function () {
        $("form#comment-form").submit(function () {
            var name = $("input[name='lmpersonname']").val();
            var content = $("textarea[name='lmcontent']").val();
            if (name.trim() == "") {
                alert("请填写昵称");
                return false;
            }
            if (content.trim() == "") {
                alert("请填写内容");
                return false;
            }
            return true;
        });
    });
</script>
</body>
</html>
